<!--主容器-->
<template>
  <el-container>
    <!--头部-->
    <el-header style="height: 45px;" id="header">
      <el-menu  class="el-menu-demo" id="header-el-menu-demo" mode="horizontal" @select="handleSelect">
        <el-menu-item index="1">测试平台</el-menu-item>
        <el-menu-item index="2">界面管理</el-menu-item>
        <el-submenu index="3">
          <template slot="title">个人中心</template>
          <el-menu-item index="3-1">个人信息</el-menu-item>
        </el-submenu>
        <el-menu-item index="4" style="float: right">退出</el-menu-item>
        <el-menu-item index="5" style="float: right">欢迎：{{this.$store.state.userMessage.user_nick_name}}</el-menu-item>
      </el-menu>
    </el-header>

    <el-container>
      <!--侧边导航栏-->
      <el-aside width="160px" id="aside">
        <el-menu default-active="0" class="el-menu-vertical-demo">
          <el-menu-item index="0">
            <i class="el-icon-setting"></i>
            <router-link to="/main">首页</router-link>
          </el-menu-item>
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span slot="title">导航一</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="1-1">选项1</el-menu-item>
              <el-menu-item index="1-2">选项2</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-menu-item index="2">
            <i class="el-icon-menu"></i>
            <span slot="title">导航二</span>
          </el-menu-item>
          <el-menu-item index="3">
            <i class="el-icon-setting"></i>
            <span slot="title">导航三</span>
          </el-menu-item>
        </el-menu>

      </el-aside>
      <el-container>
        <!--主题内容-->
        <el-main>
          <router-view/>
        </el-main>
        <!--底部-->
        <el-footer style="height: 35px;">Footer</el-footer>
      </el-container>
    </el-container>
  </el-container>
</template>

<script>
  import store from '@/vuex/store'
  export default{
    store,
    data(){
          return {

          }
      },
    methods:{
      handleSelect(key, keyPath) {
        console.log(key, keyPath);
      }
    },
    mounted(){
        console.log(this.$store.state.userMessage);
    }
  }
</script>
<style>
  html,body{
    height: 100%;
  }

  body{
    margin: 0px;
  }

  #app{
    height: 100%;
    margin-top: 0px;
  }
  .el-container.is-vertical{
    height: 100%;
  }
  .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 45px;
  }

  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }

  /*头部*/
  #header-el-menu-demo{
    height: 100%;
    line-height: 100%;
    background-color: #B3C0D1;;
  }

  .el-menu--horizontal>.el-submenu .el-submenu__title{
    height: 45px;
    line-height: 45px;
    float: right;
    color: black;
  }

  .el-menu--horizontal>.el-menu-item {
    float: left;
    height: 45px;
    line-height: 45px;
    color: black;
  }

  /*侧边导航*/
  #aside .el-menu-vertical-demo .el-submenu .el-submenu__title{
     padding-right: 45px;
  }

  #aside .el-menu-vertical-demo .el-submenu .el-menu-item {
    min-width: 100%;
  }

  #aside .el-menu-vertical-demo .el-menu-item{
    padding-right: 45px;
  }

  a:-webkit-any-link {
    color: -webkit-link;
    cursor: pointer;
    text-decoration: none;
  }
</style>
